<div id="comments">
<?php //echo $this->form ?>
	<form method="<?php echo $this->form->getMethod();?>" action="<?php echo $this->form->getAction();?>" enctype="<?php echo $this->form->getEncType();?>" id="<?php echo $this->form->getName();?>">
		<dl class="zend_form">
			<?php echo $this->form->getElement('author');?>
			<?php echo $this->form->getElement('post');?>
			<dt>&nbsp;</dt>
			<dd><div id="captcha_div"></div></dd>
			<?php echo $this->form->getElement('submit');?>
		</dl></form>
<?php if (!empty($this->comments)):?>
	<ul id="commentsData">
	<?php foreach ($this->comments as $comment):?>
		<li class="bb">
			<dl>
				<dt><em class="bigger strong high"><?php echo $comment['POST_AUTHOR']?></em>&nbsp;|&nbsp;<em class="nonhigh"><?php echo $comment['POST_POSTDATE']?></em></dt>
				<dd><?php echo $comment['POST_POST']?></dd>
			</dl>
		</li>
	<?php endforeach;?>
	</ul>
<?php endif;?>
</div>
<script type="text/javascript">
	$("input:submit, input:button, button").button();
	$("#commentForm").submit(function() {
		var cont = $("#comments").parent();
		$.post(
			$(this).attr("action"),
			$(this).serialize(),
			function(data) {
				$.get(
					'/catalog/products/comments/product/<?php echo $this->product->getAlias();?>/format/html',
					function(data) {
						$("#comments").slideUp('slow', function() {
							$("#comments").detach();
						});
						cont.html(data);
						$("#comments").slideDown('slow');
					}
				);
			}
		);
		cont.html('Добавление коментария...');
		return false;
	});

	Recaptcha.create(
		"<?php echo Zend_Registry::get('config')->recaptcha->publickey;?>",
		"captcha_div",
		{
		  theme: "red",
		  lang: "ru",
		  callback: Recaptcha.focus_response_field
		}
	);
</script>
